<template>
  <img alt="Vue logo" src="./assets/logo.png">
  <hr>
  计数器：{{count}} <button @click="increment">自增</button>
  <hr>
  <button @click="toggleShow">显示隐藏</button>
  <div class="box" v-if="show"></div>

</template>

<script>
// 1. 选项API实现  couter 和  显示隐藏
export default {
  name: 'App',
  data () {
    return {
      count: 0,
      show: true
    }
  },
  methods: {
    increment () {
      this.count ++
    },
    toggleShow () {
      this.show = !this.show
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
.box {
  width: 100px;
  height: 100px;
  background: pink;
}
</style>
